<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
    <title>API接口自动化平台</title>
    <link rel="stylesheet" href="../../static/js/plug-in/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="../../static/js/plug-in/font-awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" href="../../static/js/plug-in/dist/css/AdminLTE.css"/>
    <link rel="stylesheet" href="../../static/js/plug-in/dist/css/skins/_all-skins.min.css"/>
    <!--[if lt IE 9]>
    <script src="../../static/js/public/html5shiv.min.js" ></script>
    <script src="../../static/js/public/respond.min.js" ></script>
    <![endif]-->
    <link rel="stylesheet" href="../../static/css/public/public.css" />
    <link rel="stylesheet" href="../../static/js/plug-in/my-form-prompt/css/form-prompt.css">
    <link rel="stylesheet" href="../../static/js/json-viewer/jquery.json-viewer.css">
		
<body class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">
        <header class="main-header" id="_header"></header>
        <aside class="main-sidebar" id="_left"></aside>

        <div class="content-wrapper">
            <section class="content-header">
                <h1>添加接口</h1>
                <ol class="breadcrumb">
                    <li>
                        <a href="index.html"><i class="fa fa-dashboard"></i>首页</a>
                    </li>
                    <li>
                        <a href="school.html">接口管理</a>
                    </li>
                    <li>
                        <a href="school-add.html">添加接口</a>
                    </li>
                </ol>
            </section>
            <section class="content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="box">
                            <div class="box box-info">
                                <div class="box-header with-border">
                                    <h3 class="box-title">填写接口信息</h3>
                                </div>
                                <form class="form-horizontal" id="organize" action="#">
                                    <div class="box-body col-xs-12">
                                        <div class="col-xs-6">
                                            <div class="form-group">
                                                <label for="input-name" class="col-sm-3 control-label"><span class="my-red">*</span>接口名</label>
                                                <div class="col-sm-9" form-prompt="false" form-prompt-text="名称不能为空">
                                                    <input type="text" class="form-control" id="input-menuId" name="menuId"   />
                                                </div>
                                            </div>
                                             
                                             
                                            
                                           <div class="form-group">
                                                <label for="input-name" class="col-sm-3 control-label"><span class="my-red">*</span>接口url</label>
                                                <div class="col-sm-9" form-prompt="false" form-prompt-text="名称不能为空">
                                                    <input type="text" class="form-control" id="input-parentMenuId" name="parentMenuId"  />
                                                </div>
                                            </div>
                                            
                                            
                                            
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">接口状态</label>
                                                <div class="col-sm-9">
                                                    <label class="my-form-radio">
                                                    	可用<input type="radio" name="status" id="input-state-1" checked="checked" value="1"/>
                                                    </label>
                                                    <label class="my-form-radio">
                                                    	禁用<input type="radio" name="status" id="input-state-2" value="0"/>
                                                    </label>
                                                </div>
                                            </div>
                                            
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">系统版本</label>
                                                <div class="col-sm-9">
                                                    <input type="text" class="form-control" id="input-parentMenuId" name="parentMenuId"  />
                                                </div>
                                            </div>
                                            
                                           <div class="form-group">
		                                            <label for="input-code" class="col-sm-3 control-label"><span class="my-red">*</span>默认入参</label>
		                                            <div class="col-sm-9" form-prompt="false" form-prompt-text="编码格式错误">
		                                            	
                                                	<textarea class="form-control" id="json-input" rows="15" ></textarea>  
																										
		                                              <button type="button" class="btn btn-default pull-left" id="look">预览</button>
		                                            </div>
	                                           </div>
                                            
                                        	</div>
                                        	<div class="col-xs-6">
                                        		<div class="form-group">
                                                <label for="input-name" class="col-sm-3 control-label"><span class="my-red">*</span>所属系统</label>
                                                <div class="col-sm-9" form-prompt="false">
                                                    <select class="form-control" id="input-subject">
                                                        <option value="1">中台sit</option>
                                                        <option value="2">中台dev</option>
                                                        <option value="3">生产</option>
                                                    </select>
                                                </div>
                                            </div>
                                            
                                            <div class="form-group">
                                               <label class="col-sm-3 control-label">请求方式</label>
                                                <div class="col-sm-9">
                                                    <select class="form-control" id="input-subject">
                                                        <option value="1">GET</option>
                                                        <option value="2">POST</option>
                                                    </select>
                                                </div>
                                            </div>
                                        		
	                                       			<div class="form-group">
		                                            <label for="input-code" class="col-sm-3 control-label"><span class="my-red">*</span>接口描述</label>
		                                            <div class="col-sm-9" form-prompt="false" form-prompt-text="编码格式错误">
		                                                <textarea  class="form-control" rows="3" id="textare-menuDesc" name="menuDesc"></textarea>
		                                            </div>
	                                            </div>
	                                       	
	                                       		<div class="form-group">
		                                            <label for="input-code" class="col-sm-3 control-label"><span class="my-red">*</span>默认出参</label>
		                                            <div class="col-sm-9" form-prompt="false" form-prompt-text="编码格式错误">
		                                                <textarea class="form-control" id="json-inputrparams" rows="15" ></textarea>  
		                                              	<button type="button" class="btn btn-default pull-left" id="rlook">预览</button>
		                                            </div>
	                                           </div>
                                    	</div>
                                    </div>
                                       
                                       
                                    <div class="box-footer">
                                        <button type="button" class="btn btn-default j-btn-cancel">取消</button>
                                        <button type="button" class="btn btn-info pull-right j-submit" onclick="saveOrUpdate();">保存</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>




         <footer class="main-footer" id="_footer"></footer>
        <div class="control-sidebar-bg"></div>
    </div>
    
<!--添加模板-->    
<div class="modal fade in" id="Modal-param-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">添加角色</h4>
            </div>
            <div class="modal-body col-xs-12">
                <div class="form-horizontal"> 
                    <div class="form-group">
                    		<label for="input-code" class="col-sm-3 control-label"><span class="my-red">*</span>预览</label>
                        <div class="col-sm-9" form-prompt="false">
                            <pre id="json-renderer"></pre>
                        </div>
                    </div> 
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default pull-left" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary j-confirm-btn" id="yes">确定</button>
            </div>
        </div>
    </div>
</div>

</body>
<!--[if IE 9]>
<script src="../../static/js/plug-in/jquery/jquery-1.11.0.js"></script>
<![endif]-->
<script src="../../static/js/plug-in/jquery/jquery-2.2.3.min.js"></script>
<script src="../../static/js/json-viewer/jquery.json-viewer.js" ></script>
<script src="../../static/js/externalr.js"></script>
<script src="../../static/js/plug-in/bootstrap/js/bootstrap.min.js"></script>
<script src="../../static/js/plug-in/dist/js/app.min.js"></script>
<script src="../../static/js/public/public.js"></script>
<script src="../../static/js/plug-in/my-form-prompt/js/form-prompt.js"></script>
<link rel="stylesheet" href="../../static/js/layui/css/layui.css">
<script  src="../../static/js/layui/layui.js"></script>
<script src="../../static/js/utils.js"></script>
<script type="application/javascript">

	$(function(){
		
		
		$("#yes").click(function(){
			$('#Modal-param-add').modal('hide');
		})
		
		$("#look").click(function(){
			$('#Modal-param-add').modal('show');
			$(".modal-title").text("参数预览");
			/*var data =$("#textare-pramse").val()*/
			var input = eval('(' + $('#json-input').val() + ')');
			/*alert(data);*/
			$('#json-renderer').jsonViewer(input);
		})
		
		$("#rlook").click(function(){
			
				$('#Modal-param-add').modal('show');
				$(".modal-title").text("参数预览");
				/*var data =$("#textare-pramse").val()*/
				var input = eval('(' + $('#json-inputrparams').val() + ')');
				/*alert(data);*/
				$('#json-renderer').jsonViewer(input);
		})
	})
</script>
</html>